home *** CD-ROM | disk | FTP | other *** search
- '
- ' This script is used to automatically create and add new dialing directory
- ' entries for online services.
- '
- ' To use, just run SERVICES.SCR from QmodemPro for Windows.
- '
-
- declare sub AddCIS
- declare sub AddGEnie
- declare sub AddMCI
-
- const qq = chr(34)
-
- dialog ServicesList 6, 15, 194, 110
- caption "Add Online Service"
- groupbox "Services", -1, 8, 9, 178, 68
- cis as radiobutton "CompuServe Information Service", 101, 20, 30, 150, 12
- genie as radiobutton "GEnie", 102, 20, 42, 150, 12
- mci as radiobutton "MCI Mail", 103, 20, 54, 150, 12
- defpushbutton "OK", IDOK, 13, 88, 50, 14
- pushbutton "Cancel", IDCANCEL, 73, 88, 50, 14
- pushbutton "Help", 104, 133, 88, 50, 14
- end dialog
-
- dialog ServicesHelp 6, 15, 194, 119
- caption "Online Services Help"
- defpushbutton "OK", IDOK, 72, 97, 50, 14
- groupbox "", -1, 4, 4, 185, 86
- ltext "This script is useful for automatically creating", -1, 10, 10, 170, 8
- ltext "dialing directory entries and logon scripts for", -1, 10, 18, 170, 8
- ltext "three of the major online services: CompuServe,", -1, 10, 26, 170, 8
- ltext "GEnie, and MCI Mail. After selecting an online", -1, 10, 34, 170, 8
- ltext "service, this script will prompt for your user ID,", -1, 10, 42, 170, 8
- ltext "password, or phone number as needed. Then a phone", -1, 10, 50, 170, 8
- ltext "directory entry will automatically be created for", -1, 10, 58, 170, 8
- ltext "the service you have selected.", -1, 10, 66, 170, 8
- end dialog
-
- function ServicesList.id(104) as integer
- dim help as ServicesHelp
- dialogbox help
- end function
-
- dim sl as ServicesList
- sl.cis = 1
- do
- if dialogbox(sl) <> IDOK then
- exit do
- end if
- if sl.cis then AddCIS
- if sl.genie then AddGEnie
- if sl.mci then AddMCI
- loop
-
- function GetUniqueScriptName(prefix as string) as string
- dim scrname as string
- scrname = ConfigScriptPath + "\" + prefix + ".scr"
- dim i as integer
- i = 0
- do while exists(scrname)
- i = i + 1
- scrname = ConfigScriptPath + "\" + prefix + str(i) + ".scr"
- loop
- GetUniqueScriptName = scrname
- end function
-
- '*********************************************************************
-
- sub CreateCISCPSScript
- print #1, "striphibit on"
- print #1, "delay 1"
- print #1, "send ";qq;"^C";qq;";"
- print #1, "waitfor ";qq;"User ID: ";qq
- print #1, "send lastconnectuserid"
- print #1, "waitfor ";qq;"Password: ";qq
- print #1, "send lastconnectpassword"
- end sub
-
- sub CreateCISTELScript
- print #1, "striphibit on"
- print #1, "when match ";qq;"Host Name:";qq;" do send ";qq;"CIS";qq
- print #1, "delay 1"
- print #1, "send ";qq;"@";qq
- print #1, "timeout 5"
- print #1, "try1200:"
- print #1, "waitfor ";qq;"TERMINAL=";qq
- print #1, "timeout off"
- print #1, "send ";qq;"D1";qq
- print #1, "waitfor ";qq;"@";qq
- print #1, "send ";qq;"C 614227";qq
- print #1, "waitfor ";qq;"User ID: ";qq
- print #1, "send lastconnectuserid"
- print #1, "waitfor ";qq;"Password: ";qq
- print #1, "send lastconnectpassword"
- print #1,
- print #1, "catch err_timeout"
- print #1, "send"
- print #1, "goto try1200"
- end sub
-
- sub CreateCISTYMScript
- print #1, "striphibit on"
- print #1, "when match ";qq;"Host Name:";qq;" do send ";qq;"CIS";qq
- print #1, "delay 2"
- print #1, "send ";qq;"A";qq;";"
- print #1, "waitfor ";qq;"LOG IN";qq
- print #1, "send ";qq;"CML05";qq
- print #1, "waitfor ";qq;"User ID: ";qq
- print #1, "send lastconnectuserid"
- print #1, "waitfor ";qq;"Password: ";qq
- print #1, "send lastconnectpassword"
- end sub
-
- sub CreateCISDPCScript
- print #1, "striphibit on"
- print #1, "when match ";qq;"Host Name:";qq;" do send ";qq;"CIS";qq
- print #1, "delay 2"
- print #1, "send ";qq;"...";qq
- print #1, "waitfor ";qq;"datapac";qq
- print #1, "send ";qq;"29400138";qq
- print #1, "waitfor ";qq;"User ID: ";qq
- print #1, "send lastconnectuserid"
- print #1, "waitfor ";qq;"Password: ";qq
- print #1, "send lastconnectpassword"
- end sub
-
- sub CreateCISAKNScript
- print #1, "striphibit on"
- print #1, "when match ";qq;"Host Name:";qq;" do send ";qq;"CIS";qq
- print #1, "delay 2"
- print #1, "send ";qq;"A";qq;";"
- print #1, "waitfor ";qq;"LOG IN";qq
- print #1, "send ";qq;"COMPUSERVE";qq
- print #1, "waitfor ";qq;"User ID: ";qq
- print #1, "send lastconnectuserid"
- print #1, "waitfor ";qq;"Password: ";qq
- print #1, "send lastconnectpassword"
- end sub
-
- sub CreateCISLATScript
- print #1, "striphibit on"
- print #1, "when match ";qq;"Host Name:";qq;" do send ";qq;"CIS";qq
- print #1, "delay 2"
- print #1, "send ";qq;"...";qq
- print #1, "waitfor ";qq;"please login";qq
- print #1, "send ";qq;".CPS";qq
- print #1, "waitfor ";qq;"User ID: ";qq
- print #1, "send lastconnectuserid"
- print #1, "waitfor ";qq;"Password: ";qq
- print #1, "send lastconnectpassword"
- end sub
-
- dialog CISInfo 6, 15, 194, 224
- caption "CompuServe Information Service"
- groupbox "User Information", 101, 8, 7, 175, 52
- rtext "Your PIN", -1, 14, 25, 54, 8
- userid as edittext 102, 71, 22, 96, 12
- rtext "Your Password", -1, 14, 41, 54, 8
- password as edittext 103, 71, 38, 96, 12
- groupbox "Connection", 104, 8, 68, 175, 125
- rtext "Phone Number", -1, 14, 84, 54, 8
- number as edittext 105, 71, 81, 96, 12
- pushbutton "View Numbers...", 112, 87, 98, 63, 14
- cps as radiobutton "CompuServe Network", 106, 19, 116, 92, 12
- tel as radiobutton "SprintNet", 107, 19, 128, 92, 12
- tym as radiobutton "Tymnet", 108, 19, 140, 92, 12
- dpc as radiobutton "Canadian Datapac", 109, 19, 152, 92, 12
- akn as radiobutton "AlaskaNet", 110, 19, 164, 92, 12
- lat as radiobutton "LATA", 111, 19, 176, 92, 12
- defpushbutton "OK", 114, 10, 203, 50, 14
- pushbutton "Cancel", IDCANCEL, 70, 203, 50, 14
- pushbutton "Help", 113, 130, 203, 50, 14
- end dialog
-
- function CISInfo.id(114) as integer
- dim i as integer, seencomma as integer
- for i = 1 to len(userid)
- dim c as string
- c = mid(userid, i, 1)
- if c = "," then
- if seencomma then
- msgbox "Your PIN should be in the format 12345,6789"
- exit function
- else
- seencomma = true
- end if
- elseif c < "0" or c > "9" then
- msgbox "Your PIN should be in the format 12345,6789"
- exit function
- end if
- next i
- i = instr(userid, ",")
- if i <= 1 or i >= len(userid) then
- msgbox "Your PIN should be in the format 12345,6789"
- exit function
- end if
-
- if password = "" then
- msgbox "You need to fill in your password."
- exit function
- end if
-
- if number = "" then
- msgbox "You need to fill in a phone number."
- exit function
- end if
-
- DialogResult = IDOK
- end function
-
- function CISInfo.id(112) as integer
- if cps then viewfile ConfigScriptPath+"\cisphone.cps"
- if tel then viewfile ConfigScriptPath+"\cisphone.tel"
- if tym then viewfile ConfigScriptPath+"\cisphone.tym"
- if dpc then viewfile ConfigScriptPath+"\cisphone.dpc"
- if akn then viewfile ConfigScriptPath+"\cisphone.akn"
- if lat then viewfile ConfigScriptPath+"\cisphone.lat"
- end function
-
- sub AddCIS
- dim info as CISInfo
- info.cps = 1
- if dialogbox(info) = IDOK then
- dim scriptname as string
- scriptname = GetUniqueScriptName("cis")
- open scriptname for output as #1
- if info.cps then CreateCISCPSScript
- if info.tel then CreateCISTELScript
- if info.tym then CreateCISTYMScript
- if info.dpc then CreateCISDPCScript
- if info.akn then CreateCISAKNScript
- if info.lat then CreateCISLATScript
- close #1
- dim entry as phoneentry
- entry.systemname = "CompuServe"
- entry.number(1) = info.number
- entry.userid = info.userid
- entry.password = info.password
- entry.scriptfile = scriptname
- entry.emulation = vidtex
- entry.protocol = bplus
- entry.device = "-Default-"
- entry.iconfile = "bbsicons.dll"
- entry.iconid = 2
- addentry entry
- msgbox "Phone directory entry for CompuServe created."
- end if
- catch err_fileopen
- msgbox "Could not create script: " + scriptname
- end sub
-
- '*********************************************************************
-
- sub CreateGEnieScript
- print #1, "striphibit on"
- print #1, "duplex off"
- print #1, "delay 2"
- print #1, "send "+qq+"HHH"+qq+";"
- print #1, "waitfor "+qq+"U#="+qq
- print #1, "send lastconnectuserid + "+qq+","+qq+" + lastconnectpassword"
- end sub
-
- dialog GEnieInfo 6, 15, 194, 127
- caption "GEnie"
- groupbox "User Information", 101, 8, 7, 175, 52
- rtext "Your User ID", -1, 14, 25, 54, 8
- userid as edittext 102, 71, 22, 96, 12
- rtext "Your Password", -1, 14, 41, 54, 8
- password as edittext 103, 71, 38, 96, 12
- groupbox "Connection", 104, 8, 68, 175, 29
- rtext "Phone Number", -1, 14, 84, 54, 8
- number as edittext 105, 71, 81, 96, 12
- defpushbutton "OK", 114, 10, 106, 50, 14
- pushbutton "Cancel", IDCANCEL, 70, 106, 50, 14
- pushbutton "Help", 113, 130, 106, 50, 14
- end dialog
-
- function GEnieInfo.id(114) as integer
- if userid = "" then
- msgbox "You need to fill in your User ID."
- exit function
- end if
-
- if password = "" then
- msgbox "You need to fill in your password."
- exit function
- end if
-
- if number = "" then
- msgbox "You need to fill in a phone number."
- exit function
- end if
-
- DialogResult = IDOK
- end function
-
- sub AddGEnie
- dim info as GEnieInfo
- if dialogbox(info) = IDOK then
- dim scriptname as string
- scriptname = GetUniqueScriptName("genie")
- open scriptname for output as #1
- CreateGEnieScript
- close #1
- dim entry as phoneentry
- entry.systemname = "GEnie"
- entry.number(1) = info.number
- entry.userid = info.userid
- entry.password = info.password
- entry.scriptfile = scriptname
- entry.emulation = ansi
- entry.protocol = zmodem
- entry.device = "-Default-"
- entry.iconfile = "bbsicons.dll"
- entry.iconid = 3
- addentry entry
- msgbox "Phone directory entry for GEnie created."
- end if
- catch err_fileopen
- msgbox "Could not create script: " + scriptname
- end sub
-
- '*********************************************************************
-
- sub CreateMCIScript
- print #1, "striphibit on"
- print #1, "waitfor "+qq+"your user name:"+qq
- print #1, "send lastconnectuserid"
- print #1, "waitfor "+qq+"Password:"+qq
- print #1, "send lastconnectpassword"
- end sub
-
- dialog MCIInfo 6, 15, 194, 87
- caption "MCI Mail"
- groupbox "User Information", 101, 8, 7, 175, 52
- rtext "Your User Name", -1, 14, 25, 54, 8
- userid as edittext 102, 71, 22, 96, 12
- rtext "Your Password", -1, 14, 41, 54, 8
- password as edittext 103, 71, 38, 96, 12
- defpushbutton "OK", 114, 10, 65, 50, 14
- pushbutton "Cancel", IDCANCEL, 70, 65, 50, 14
- pushbutton "Help", 113, 130, 65, 50, 14
- end dialog
-
- function MCIInfo.id(114) as integer
- if userid = "" then
- msgbox "You need to fill in your User ID."
- exit function
- end if
-
- if password = "" then
- msgbox "You need to fill in your password."
- exit function
- end if
-
- DialogResult = IDOK
- end function
-
- sub AddMCI
- dim info as MCIInfo
- if dialogbox(info) = IDOK then
- dim scriptname as string
- scriptname = GetUniqueScriptName("mci")
- open scriptname for output as #1
- CreateMCIScript
- close #1
- dim entry as phoneentry
- entry.systemname = "MCI Mail"
- entry.number(1) = "1-800-967-9600"
- entry.userid = info.userid
- entry.password = info.password
- entry.scriptfile = scriptname
- entry.emulation = ansi
- entry.protocol = zmodem
- entry.device = "-Default-"
- entry.iconfile = "bbsicons.dll"
- entry.iconid = 4
- addentry entry
- msgbox "Phone directory entry for MCI Mail created."
- end if
- catch err_fileopen
- msgbox "Could not create script: " + scriptname
- end sub
-